home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / shllutil.lha / shellutils-1.8 / configure < prev    next >
Text File  |  1992-10-22  |  19KB  |  794 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec_prefix=PREFIX] [--with-PROGRAM] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec_prefix, and --no-create.
  23.  
  24. trap 'rm -f conftest* core; exit 1' 1 3 15
  25.  
  26. for arg
  27. do
  28.   # Handle --exec_prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  52.         no_create=1 ;;
  53.  
  54.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  55.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  56.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  57.     next_prefix=yes ;;
  58.  
  59.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  60.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  61.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  62.     next_srcdir=yes ;;
  63.  
  64.      -with-* | --with-*) ;;
  65.  
  66.      *) ;;
  67.     esac
  68.   fi
  69. done
  70.  
  71. rm -f conftest*
  72. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  73.  
  74. # A filename unique to this package, relative to the directory that
  75. # configure is in, which we can look for to find out if srcdir is correct.
  76. unique_file=src/stty.c
  77.  
  78. # Find the source files, if location was not specified.
  79. if test -z "$srcdir"; then
  80.   srcdirdefaulted=yes
  81.   # Try the directory containing this script, then `..'.
  82.   prog=$0
  83.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  84.   test "X$confdir" = "X$prog" && confdir=.
  85.   srcdir=$confdir
  86.   if test ! -r $srcdir/$unique_file; then
  87.     srcdir=..
  88.   fi
  89. fi
  90. if test ! -r $srcdir/$unique_file; then
  91.   if test x$srcdirdefaulted = xyes; then
  92.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  93.   else
  94.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  95.   fi
  96.   exit 1
  97. fi
  98. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  99. # But we can't avoid them for `..', to make subdirectories work.
  100. case $srcdir in
  101.   .|/*|~*) ;;
  102.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  103. esac
  104.  
  105. if test -z "$CC"; then
  106.   echo checking for gcc
  107.   saveifs="$IFS"; IFS="${IFS}:"
  108.   for dir in $PATH; do
  109.     test -z "$dir" && dir=.
  110.     if test -f $dir/gcc; then
  111.       CC="gcc"
  112.       break
  113.     fi
  114.   done
  115.   IFS="$saveifs"
  116. fi
  117. test -z "$CC" && CC="cc"
  118.  
  119. # Find out if we are using GNU C, under whatever name.
  120. cat <<EOF > conftest.c
  121. #ifdef __GNUC__
  122.   yes
  123. #endif
  124. EOF
  125. ${CC-cc} -E conftest.c > conftest.out 2>&1
  126. if egrep yes conftest.out >/dev/null 2>&1; then
  127.   GCC=1 # For later tests.
  128.   CC="$CC -O"
  129. fi
  130. rm -f conftest*
  131.  
  132. echo checking how to run the C preprocessor
  133. if test -z "$CPP"; then
  134.   CPP='${CC-cc} -E'
  135.   cat <<EOF > conftest.c
  136.  
  137. #include <stdio.h>
  138. EOF
  139. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  140. if test -z "$err"; then
  141.   :
  142. else
  143.   CPP=/lib/cpp
  144. fi
  145. rm -f conftest*
  146. fi
  147.  
  148. if test -n "$GCC"; then
  149.   echo checking whether -traditional is needed
  150.   pattern="Autoconf.*'x'"
  151.   prog='#include <sgtty.h>
  152. Autoconf TIOCGETP'
  153.   cat <<EOF > conftest.c
  154.  
  155. $prog
  156. EOF
  157. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  158. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  159.   need_trad=1
  160. fi
  161. rm -f conftest*
  162.  
  163.  
  164.   if test -z "$need_trad"; then
  165.     prog='#include <termio.h>
  166. Autoconf TCGETA'
  167.     cat <<EOF > conftest.c
  168.  
  169. $prog
  170. EOF
  171. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  172. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  173.   need_trad=1
  174. fi
  175. rm -f conftest*
  176.  
  177.   fi
  178.   test -n "$need_trad" && CC="$CC -traditional"
  179. fi
  180.  
  181. # Make sure to not get the incompatible SysV /etc/install and
  182. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  183. # or the SunOS /usr/etc/install directory, or the AIX /bin/install.
  184. if test -z "$INSTALL"; then
  185.   echo checking for install
  186.   saveifs="$IFS"; IFS="${IFS}:"
  187.   for dir in $PATH; do
  188.     test -z "$dir" && dir=.
  189.     case $dir in
  190.     /etc|/usr/sbin|/usr/etc) ;;
  191.     *)
  192.       if test -f $dir/install; then
  193.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  194.       : # AIX
  195.     else
  196.       INSTALL="$dir/install -c"
  197.       INSTALL_PROGRAM='$(INSTALL)'
  198.       INSTALL_DATA='$(INSTALL) -m 644'
  199.       break
  200.     fi
  201.       fi
  202.       ;;
  203.     esac
  204.   done
  205.   IFS="$saveifs"
  206. fi
  207. INSTALL=${INSTALL-cp}
  208. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  209. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  210.  
  211. if test -z "$RANLIB"; then
  212.   echo checking for ranlib
  213.   saveifs="$IFS"; IFS="${IFS}:"
  214.   for dir in $PATH; do
  215.     test -z "$dir" && dir=.
  216.     if test -f $dir/ranlib; then
  217.       RANLIB="ranlib"
  218.       break
  219.     fi
  220.   done
  221.   IFS="$saveifs"
  222. fi
  223. test -z "$RANLIB" && RANLIB="@:"
  224.  
  225. echo checking for AIX
  226. cat <<EOF > conftest.c
  227.  
  228. #ifdef _AIX
  229.   yes
  230. #endif
  231.  
  232. EOF
  233. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  234. if egrep "yes" conftest.out >/dev/null 2>&1; then
  235.   DEFS="$DEFS -D_ALL_SOURCE=1"
  236. fi
  237. rm -f conftest*
  238.  
  239.  
  240. echo checking for minix/config.h
  241. cat <<EOF > conftest.c
  242.  
  243. #include <minix/config.h>
  244. EOF
  245. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  246. if test -z "$err"; then
  247.   MINIX=1
  248. fi
  249. rm -f conftest*
  250.  
  251. # The Minix shell can't assign to the same variable on the same line!
  252. if test -n "$MINIX"; then
  253.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  254.   DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  255.   DEFS="$DEFS -D_MINIX=1"
  256. fi
  257.  
  258. echo checking for POSIXized ISC
  259. if test -d /etc/conf/kconfig.d &&
  260.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  261. then
  262.   ISC=1 # If later tests want to check for ISC.
  263.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  264.   if test -n "$GCC"; then
  265.     CC="$CC -posix"
  266.   else
  267.     CC="$CC -Xp"
  268.   fi
  269. fi
  270.  
  271. echo checking for SCO UNIX libintl
  272. cat <<EOF > conftest.c
  273.  
  274. #if defined(M_UNIX)
  275.   yes
  276. #endif
  277.  
  278. EOF
  279. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  280. if egrep "yes" conftest.out >/dev/null 2>&1; then
  281.   SCO_UNIX=1
  282. fi
  283. rm -f conftest*
  284.  
  285. test -n "$SCO_UNIX" && test -f /lib/libintl.a &&
  286.   LIBS="$LIBS -lintl" # For strftime.
  287.  
  288. echo checking for uname
  289. echo "
  290. main() { exit(0); } t() { 
  291. /* Override any gcc2 internal prototype to avoid an error.  */
  292. extern char uname(); uname(); }" > conftest.c
  293. if eval $compile; then
  294.   PROGS="$PROGS uname" MAN="$MAN uname.1" have_uname=1
  295. fi
  296. rm -f conftest*
  297.  
  298. echo checking for limits.h
  299. cat <<EOF > conftest.c
  300.  
  301. #include <limits.h>
  302. EOF
  303. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  304. if test -z "$err"; then
  305.   DEFS="$DEFS -DHAVE_LIMITS_H=1"
  306. fi
  307. rm -f conftest*
  308.  
  309. echo checking for syslog.h
  310. cat <<EOF > conftest.c
  311.  
  312. #include <syslog.h>
  313. EOF
  314. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  315. if test -z "$err"; then
  316.   DEFS="$DEFS -DHAVE_SYSLOG_H=1"
  317. fi
  318. rm -f conftest*
  319.  
  320. echo checking for shadow password routines
  321. echo '#include <shadow.h>' > conftest.c
  322. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  323. if egrep "sp_pwdp" conftest.out >/dev/null 2>&1; then
  324.   DEFS="$DEFS -DHAVE_SHADOW_H=1"
  325. fi
  326. rm -f conftest*
  327.  
  328. echo checking for ANSI C header files
  329. cat <<EOF > conftest.c
  330.  
  331. #include <stdlib.h>
  332. #include <stdarg.h>
  333. #include <string.h>
  334. #include <float.h>
  335. #include <limits.h>
  336. EOF
  337. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  338. if test -z "$err"; then
  339.   DEFS="$DEFS -DSTDC_HEADERS=1"
  340. fi
  341. rm -f conftest*
  342.  
  343. echo checking for unistd.h
  344. cat <<EOF > conftest.c
  345.  
  346. #include <unistd.h>
  347. EOF
  348. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  349. if test -z "$err"; then
  350.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  351. fi
  352. rm -f conftest*
  353.  
  354. echo checking for BSD string and memory functions
  355. echo "#include <strings.h>
  356. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  357. if eval $compile; then
  358.   :
  359. else
  360.   DEFS="$DEFS -DUSG=1"
  361. fi
  362. rm -f conftest*
  363.  
  364. echo checking for uid_t in sys/types.h
  365. echo '#include <sys/types.h>' > conftest.c
  366. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  367. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  368.   :
  369. else 
  370.   DEFS="$DEFS -Duid_t=int" DEFS="$DEFS -Dgid_t=int"
  371. fi
  372. rm -f conftest*
  373.  
  374. echo checking for size_t in sys/types.h
  375. echo '#include <sys/types.h>' > conftest.c
  376. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  377. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  378.   :
  379. else 
  380.   DEFS="$DEFS -Dsize_t=unsigned"
  381. fi
  382. rm -f conftest*
  383.  
  384. for func in gethostname getusershell mktime stime strcspn strstr strtol strtoul strtod
  385. do
  386. echo checking for ${func}
  387. echo "
  388. main() { exit(0); } t() { 
  389. /* Override any gcc2 internal prototype to avoid an error.  */
  390. extern char ${func}(); ${func}(); }" > conftest.c
  391. if eval $compile; then
  392.   :
  393. else
  394.   LIBOBJS="$LIBOBJS ${func}.o"
  395. fi
  396. rm -f conftest*
  397.  
  398. done
  399.  
  400. for func in strerror ftime
  401. do
  402. trfrom='[a-z]' trto='[A-Z]'
  403. echo checking for ${func}
  404. echo "
  405. main() { exit(0); } t() { 
  406. /* Override any gcc2 internal prototype to avoid an error.  */
  407. extern char ${func}(); ${func}(); }" > conftest.c
  408. if eval $compile; then
  409.   DEFS="$DEFS -DHAVE_`echo $func|tr "$trfrom" "$trto"`=1"
  410. fi
  411. rm -f conftest*
  412. done
  413.  
  414.  
  415. echo checking for setpriority
  416. echo "#include <sys/time.h>
  417. #include <sys/resource.h>
  418. main() { exit(0); } t() { setpriority(0, 0, 0); }" > conftest.c
  419. if eval $compile; then
  420.   PROGS="$PROGS nice nohup" MAN="$MAN nice.1 nohup.1"
  421. fi
  422. rm -f conftest*
  423.  
  424. case "$PROGS" in
  425. *nice*) ;;
  426. *)
  427. echo checking for nice
  428. echo "
  429. main() { exit(0); } t() { nice(); }" > conftest.c
  430. if eval $compile; then
  431.   DEFS="$DEFS -DNICE_PRIORITY=1" PROGS="$PROGS nice nohup" MAN="$MAN nice.1 nohup.1"
  432. fi
  433. rm -f conftest*
  434.  ;;
  435. esac
  436.  
  437. case "$LIBOBJS" in
  438. *gethostname*) test -n "$have_uname" && DEFS="$DEFS -DHAVE_UNAME=1"
  439. ;;
  440. esac
  441.  
  442. echo checking for ut_host in struct utmp
  443. echo "#include <sys/types.h>
  444. #include <utmp.h>
  445. main() { exit(0); } t() { struct utmp ut; ut.ut_host; }" > conftest.c
  446. if eval $compile; then
  447.   DEFS="$DEFS -DHAVE_UT_HOST=1"
  448. fi
  449. rm -f conftest*
  450.  
  451.  
  452. echo checking for POSIX termios
  453. echo "#include <sys/types.h>
  454. #include <unistd.h>
  455. #include <termios.h>
  456. main() { exit(0); } t() { /* SunOS 4.0.3 has termios.h but not the library calls.  */
  457. tcgetattr(0, 0); }" > conftest.c
  458. if eval $compile; then
  459.   have_termios=1
  460. fi
  461. rm -f conftest*
  462.  
  463. if test -n "$have_termios"; then
  464. PROGS="$PROGS stty" MAN="$MAN stty.1"
  465. echo checking for c_line in struct termios
  466. echo "#include <sys/types.h>
  467. #include <termios.h>
  468. main() { exit(0); } t() { struct termios t; t.c_line; }" > conftest.c
  469. if eval $compile; then
  470.   DEFS="$DEFS -DHAVE_C_LINE=1"
  471. fi
  472. rm -f conftest*
  473.  
  474.  
  475. echo checking for sys/ptem.h
  476. cat <<EOF > conftest.c
  477.  
  478. #include <sys/ptem.h>
  479. EOF
  480. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  481. if test -z "$err"; then
  482.   have_ptem=1 DEFS="$DEFS -DWINSIZE_IN_PTEM=1"
  483. fi
  484. rm -f conftest*
  485.  
  486. echo checking for broken window size ioctl
  487. echo "#include <sys/types.h>
  488. #include <termios.h>" > conftest.c
  489. test -n "$have_ptem" && echo "#include <sys/ptem.h>" >> conftest.c
  490. echo "main() {
  491. #ifndef TIOCGWINSZ
  492. exit(0);
  493. #else
  494. struct winsize w;
  495. exit(ioctl(0, TIOCGWINSZ, &w));
  496. #endif
  497. }" >> conftest.c
  498. eval $compile
  499. if test -s conftest && ./conftest 2>/dev/null; then :
  500. else DEFS="$DEFS -DGWINSZ_BROKEN=1"
  501. fi
  502. rm -f conftest conftest.c
  503. fi
  504.  
  505. echo checking for vprintf
  506. echo "
  507. main() { exit(0); } t() { vprintf(); }" > conftest.c
  508. if eval $compile; then
  509.   DEFS="$DEFS -DHAVE_VPRINTF=1"
  510. else
  511.   vprintf_missing=1
  512. fi
  513. rm -f conftest*
  514.  
  515. if test -n "$vprintf_missing"; then
  516. echo checking for _doprnt
  517. echo "
  518. main() { exit(0); } t() { _doprnt(); }" > conftest.c
  519. if eval $compile; then
  520.   DEFS="$DEFS -DHAVE_DOPRNT=1"
  521. fi
  522. rm -f conftest*
  523.  
  524. fi
  525.  
  526. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  527. # for constant arguments.  Useless!
  528. echo checking for working alloca.h
  529. echo "#include <alloca.h>
  530. main() { exit(0); } t() { char *p = alloca(2 * sizeof(int)); }" > conftest.c
  531. if eval $compile; then
  532.   DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  533. fi
  534. rm -f conftest*
  535.  
  536. decl="#ifdef __GNUC__
  537. #define alloca __builtin_alloca
  538. #else
  539. #if HAVE_ALLOCA_H
  540. #include <alloca.h>
  541. #else
  542. #ifdef _AIX
  543.  #pragma alloca
  544. #else
  545. char *alloca ();
  546. #endif
  547. #endif
  548. #endif
  549. "
  550. echo checking for alloca
  551. echo "$decl
  552. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  553. if eval $compile; then
  554.   :
  555. else
  556.   alloca_missing=1
  557. fi
  558. rm -f conftest*
  559.  
  560. if test -n "$alloca_missing"; then
  561.   SAVELIBS="$LIBS"
  562.   # Maybe alloca is in a different library.
  563.   #if test -f /usr/ucblib/libucb.a; then
  564.     # Avoid the broken BSD compatibility library as much as possible.
  565.     #LIBS="$LIBS -L/usr/ucblib -lc -lucb" trylib=-lucb # SVR4
  566.   #el
  567.   if test -f /lib/libPW.a; then
  568.     LIBS="$LIBS -lPW" trylib=-lPW # SVR2 and SVR3
  569.   fi
  570.   if test -n "$trylib"; then
  571.     alloca_missing=
  572.     echo checking for alloca in $trylib
  573. echo "$decl
  574. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  575. if eval $compile; then
  576.   :
  577. else
  578.   alloca_missing=1
  579. fi
  580. rm -f conftest*
  581.  
  582.   fi
  583.   if test -n "$alloca_missing"; then
  584.     LIBS="$SAVELIBS" ALLOCA=alloca.o
  585.   fi
  586. fi
  587.  
  588. echo checking for struct tm in time.h
  589. echo "#include <sys/types.h>
  590. #include <time.h>
  591. main() { exit(0); } t() { struct tm *tp; }" > conftest.c
  592. if eval $compile; then
  593.   :
  594. else
  595.   DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  596. fi
  597. rm -f conftest*
  598.  
  599. decl='#include <sys/types.h>
  600. '
  601. case "$DEFS" in
  602.   *TM_IN_SYS_TIME*) decl="$decl #include <sys/time.h>
  603. " ;;
  604.   *) decl="$decl #include <time.h>
  605. " ;;
  606. esac
  607. echo checking for tm_zone in struct tm
  608. echo "$decl
  609. main() { exit(0); } t() { struct tm tm; tm.tm_zone; }" > conftest.c
  610. if eval $compile; then
  611.   DEFS="$DEFS -DHAVE_TM_ZONE=1"
  612. else
  613.   no_tm_zone=1
  614. fi
  615. rm -f conftest*
  616.  
  617. if test -n "$no_tm_zone"; then
  618. echo checking for tzname
  619. echo "#include <time.h>
  620. #ifndef tzname /* For SGI.  */
  621. extern char *tzname[]; /* RS6000 and others want it this way.  */
  622. #endif
  623. main() { exit(0); } t() { atoi(*tzname); }" > conftest.c
  624. if eval $compile; then
  625.   DEFS="$DEFS -DHAVE_TZNAME=1"
  626. fi
  627. rm -f conftest*
  628.  
  629. fi
  630.  
  631. echo checking for directory library header
  632. echo checking for dirent.h
  633. cat <<EOF > conftest.c
  634.  
  635. #include <dirent.h>
  636. EOF
  637. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  638. if test -z "$err"; then
  639.   DEFS="$DEFS -DDIRENT=1" dirheader=dirent.h
  640. fi
  641. rm -f conftest*
  642.  
  643. if test -z "$dirheader"; then
  644. echo checking for sys/ndir.h
  645. cat <<EOF > conftest.c
  646.  
  647. #include <sys/ndir.h>
  648. EOF
  649. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  650. if test -z "$err"; then
  651.   DEFS="$DEFS -DSYSNDIR=1" dirheader=sys/ndir.h
  652. fi
  653. rm -f conftest*
  654.  
  655. fi
  656. if test -z "$dirheader"; then
  657. echo checking for sys/dir.h
  658. cat <<EOF > conftest.c
  659.  
  660. #include <sys/dir.h>
  661. EOF
  662. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  663. if test -z "$err"; then
  664.   DEFS="$DEFS -DSYSDIR=1" dirheader=sys/dir.h
  665. fi
  666. rm -f conftest*
  667.  
  668. fi
  669.  
  670. echo checking for closedir return value
  671. cat <<EOF > conftest.c
  672. #include <sys/types.h>
  673. #include <$dirheader>
  674. int closedir(); main() { exit(0); }
  675. EOF
  676. eval $compile
  677. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  678.   :
  679. else
  680.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  681. fi
  682. rm -f conftest*
  683.  
  684. echo checking for Xenix
  685. cat <<EOF > conftest.c
  686.  
  687. #if defined(M_XENIX) && !defined(M_UNIX)
  688.   yes
  689. #endif
  690.  
  691. EOF
  692. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  693. if egrep "yes" conftest.out >/dev/null 2>&1; then
  694.   XENIX=1
  695. fi
  696. rm -f conftest*
  697.  
  698. if test -n "$XENIX"; then
  699.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  700.   LIBS="$LIBS -lx"
  701.   case "$DEFS" in
  702.   *SYSNDIR*) ;;
  703.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  704.   esac
  705. fi
  706.  
  707. echo checking for libinet
  708. # Needed on ISC for syslog.
  709. test -f /usr/lib/libinet.a && LIBS="$LIBS -linet"
  710.  
  711. echo checking for libsec
  712. # Needed on SysV for shadow passwords.
  713. test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
  714.  
  715. if test -n "$prefix"; then
  716.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  717.   prsub="s%^prefix[     ]*=.*$%prefix = $prefix%"
  718. fi
  719. if test -n "$exec_prefix"; then
  720.   prsub="$prsub
  721. s%^exec_prefix[     ]*=.*$%exec_prefix = $exec_prefix%"
  722. fi
  723.  
  724. trap 'rm -f config.status; exit 1' 1 3 15
  725. echo creating config.status
  726. rm -f config.status
  727. cat <<EOF > config.status
  728. #!/bin/sh
  729. # Generated automatically by configure.
  730. # Run this file to recreate the current configuration.
  731. # This directory was configured as follows,
  732. # on host `(hostname || uname -n) 2>/dev/null`:
  733. #
  734. # $0 $*
  735.  
  736. case "\$1" in
  737.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  738.   exec /bin/sh $0 $* ;;
  739. esac
  740.  
  741. trap 'rm -f Makefile lib/Makefile src/Makefile man/Makefile; exit 1' 1 3 15
  742. PROGS='$PROGS'
  743. MAN='$MAN'
  744. CC='$CC'
  745. CPP='$CPP'
  746. INSTALL='$INSTALL'
  747. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  748. INSTALL_DATA='$INSTALL_DATA'
  749. RANLIB='$RANLIB'
  750. LIBOBJS='$LIBOBJS'
  751. ALLOCA='$ALLOCA'
  752. LIBS='$LIBS'
  753. srcdir='$srcdir'
  754. DEFS='$DEFS'
  755. prefix='$prefix'
  756. exec_prefix='$exec_prefix'
  757. prsub='$prsub'
  758. EOF
  759. cat <<\EOF >> config.status
  760.  
  761. top_srcdir=$srcdir
  762. for file in Makefile lib/Makefile src/Makefile man/Makefile; do
  763.   srcdir=$top_srcdir
  764.   # Remove last slash and all that follows it.  Not all systems have dirname.
  765.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  766.   if test "$dir" != "$file"; then
  767.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  768.     test ! -d $dir && mkdir $dir
  769.   fi
  770.   echo creating $file
  771.   rm -f $file
  772.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  773.   sed -e "
  774. $prsub
  775. s%@PROGS@%$PROGS%g
  776. s%@MAN@%$MAN%g
  777. s%@CC@%$CC%g
  778. s%@CPP@%$CPP%g
  779. s%@INSTALL@%$INSTALL%g
  780. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  781. s%@INSTALL_DATA@%$INSTALL_DATA%g
  782. s%@RANLIB@%$RANLIB%g
  783. s%@LIBOBJS@%$LIBOBJS%g
  784. s%@ALLOCA@%$ALLOCA%g
  785. s%@LIBS@%$LIBS%g
  786. s%@srcdir@%$srcdir%g
  787. s%@DEFS@%$DEFS%" $top_srcdir/${file}.in >> $file
  788. done
  789.  
  790. EOF
  791. chmod +x config.status
  792. test -n "$no_create" || ./config.status
  793.  
  794.